package com.tedu.egvehicle1.controller;

import com.tedu.egvehicle1.base.response.JsonResult;
import com.tedu.egvehicle1.mapper.NoticeMapper;
import com.tedu.egvehicle1.pojo.vo.NoticeListVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/v1/notice")
@Tag(name = "首页公告")
public class NoticeController {
    @Autowired
    private NoticeMapper noticeMapper;

    @GetMapping("/list")
    @Operation(summary = "公告")
    public JsonResult list(){
        List<NoticeListVO> listVO = noticeMapper.select();
        return JsonResult.success(listVO);
    }
}
